export {}

class Person{
	name!: string; 
	getName():void{
		console.log(this.name)
	}
}
let p1 = new Person()
p1.name = 'jinyq'
p1.getName();

class User{
	myName!:string;
	constructor(myName:string){
		this.myName = myName
	}
	get name(){
		return this.myName
	}
	set name(value){
		this.myName = value
	}
}
let user = new User('jinyq')
user.name = 'Jack'
console.log(user.name)

class Animal{
	public readonly name!:string
	constructor(name:string){
		this.name = name
	}
	changeName(){
		this.name= name
	}
}

class Person2{
	name:string;
	age:number;
	constructor(name:string,age:number){
		this.name = name;
		this.age = age
	}
	getName():string{
		return this.name
	}
	setName(name:string):void{
		this.name = name
	}
}
class Student extends Person2{
	stuNo:number;
	constructor(name:string,age:number,stuNo:number){
		super(name,age);
		this.stuNo = stuNo
	}
	getStuNo(){
		return this.stuNo
	}
	setStuNo(stuNo:number):void{
		this.stuNo = stuNo
	}
}
let s1 = new Student('jin',23,2310)


